<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>假日活动列表</title>
<meta name="viewport"
	content="width=device-width,initial-scale=1,maximum-scale=1.0" />
<#include "/view/admin/listHead.html"/>

<script type="text/javascript">
	function query(dm) {
		var href = "${base}/festivalact/list?";

		href += 'festName=' + $('#festName').val()+'&';
		href += 'reserve=' + $('#reserve').val();
		
		href += '&'

		href += 'ext4=' + $('#ext4').val();
		location.href = href;
	}
	
	
	$(function(){
		   $('#createTime').datetimepicker({

         	　　language: 'zh-CN',
         	　　autoclose: true,
         	　　todayHighlight: true
         	});
       
	})
</script>
</head>
<body>


	<!-- <div class="list-path" > <span style="margin-left: 50px;"><span class="glyphicon glyphicon-home"></span>假日活动列表</span></div>
  	
  	

<div class="table-class">

      <div class="input-group table-query" style="margin-top:25px;margin-left: 50px;">
            <input type="text" class="form-control" id="q" name="festTheme" value="${festTheme!}" placeholder="活动主题" style="width: 200px;" >&nbsp;&nbsp;&nbsp;&nbsp;
            <a class="btn btn-info" href="javascript:${base}/festivalact/list(this)"><span class="glyphicon glyphicon-search"></span> 查找</a>
        <div class="template-muban"><a href="${base}/festivalact/goAdd" class="btn btn-info" >新增</a></div>
        </div>
      <hr/> 
     -->

	<div class="table-class">
		<div class="panel panel-default" style="margin: 10px 50px 10px;">
			<div class="panel-body">
				<form class="bs-example bs-example-form" role="form">

					<div class="input-group">
						<span class="input-group-addon">活动名称</span> <input type="text"
							id="festName" value="${festName!}" class="form-control"
							placeholder="请输入活动名称">
					</div>
						<span class="bank-label">&nbsp;</span>
				<!-- 	<div class="input-group">
						<span class="input-group-addon">活动主题</span> <input type="text"
							id="festTheme" value="${festTheme!}" class="form-control"
							placeholder="请输入活动主题">
					</div>
					<span class="bank-label">&nbsp;</span> -->


					<div class="input-group">
						<span class="input-group-addon">是否显示在首页</span> <select id="ext4"
							name="ext4" class="form-control">
							<option value="">请选择</option>
							<option value="1"<#if ext4 ?? &
								ext4==1>selected</#if>>是</option>
							<option value="0"<#if ext4 ?? &
								ext4==0>selected</#if> >否</option>
						</select>
					</div>
					
					<span class="bank-label">&nbsp;</span>
					<div class="input-group">
						<span class="input-group-addon">是否可预定</span> <select id="reserve"
							name="reserve" class="form-control">
							<option value="">请选择</option>
							<option value="1"<#if reserve ?? &
								reserve==1>selected</#if>>是</option>
							<option value="0"<#if reserve ?? &
								reserve==0>selected</#if> >否</option>
						</select>
					</div>
				
                

					<div class="input-group" style="text-align: right;">
						<a class="btn btn-info" href="javascript:query(this)"><span
							class="glyphicon glyphicon-search"></span> 查找</a>

					</div>
				</form>
			</div>
		</div>

		<#include "/view/admin/opermsg.html"/>
		<table class="table table-hover table-bordered">
			<thead>
			  <tr>
			  <td colspan="14" >
            <div  class="btn-toolbar table-add" role="toolbar">
                <div class="btn-group">
                    <a href="${base}/festivalact/goAdd" class="btn btn-primary">新增</a>
                </div>
            </div>
   		     </td></tr>
        
				<tr  class="table-head">
					<th>序号</th>
					<!-- <th>活动主题</th> -->
				   <th>活动名称</th>
					<th>活动地点</th>
					<th>开始时间</th>
					<!--    <th>活动结束时间</th> -->
					<th>活动代言人</th>
					<th>活动金额(元)</th>
					<!-- <th>是否出行推荐</th> -->
					<!--   <th>活动优惠价格</th> -->

					<th style="width: 180px">操作</th>
				</tr>
			</thead>
			<tbody>
				<#list pagination.list as c>
				<tr>

					<td>${(pagination.pageNo-1)*pagination.pageSize+1+c_index}</td>
					<!-- <td>${c.festTheme!}</td> -->
					<td>${c.festName!}</td>

					<td>${c.venue! }</td>
					<td><#if
						(c.beginTime)??>${c.beginTime?string('yyyy-MM-dd')}</#if></td>
					<!--  <td>	<#if (c.endTime)??>${c.endTime?string('yyyy-MM-dd')}</#if></td> -->
					<td>${c.nickName! }</td>
					<td>${c.festAmount! }</td>
<!-- 					<td>
						<#if  c.ext5?? && c.ext5 = 1>  
						   是
						<#else> 
				                     否
						</#if>										
					</td> -->
					<!--   <td>${c.favorablePrice! }</td> -->
					<td>					  						
					  <@shiro.hasPermission name="9.1.2">	
						<a
						href="${base}/festivalact/goAdd?festivalActId=${c.festivalActId! }"
						class="btn btn-primary">修改</a>
					  </@shiro.hasPermission>	 
						<@shiro.hasPermission name="9.1.1">
					    <a
						href="${base}/festivalact/detail?festivalActId=${c.festivalActId! }"
						class="btn btn-primary">详情</a> 
					  </@shiro.hasPermission>	
					     <a
						href="${base}/festivalact/QRcode?festivalActId=${c.festivalActId!}&festUrl=${c.festUrl!}"
						class="btn btn-primary">二维码</a> 
						  <@shiro.hasPermission name="9.1.3">	
						<a
						href="javascript:doDelete('${c.festivalActId!?string }')"
						class="btn btn-primary">删除</a>
					  </@shiro.hasPermission>	 
						</td>
				</tr>


				</#list> <#if 0==pagination.totalCount>
				<tr>
					<td colspan="7" style="color: red">没有相关数据</td>
				</tr>
				</#if>
				<!-- <tr>
					<td colspan="26+1">
						<div style="text-align: left; margin-left: 50px;">
							<a href="${base}/festivalact/goAdd" class="btn btn-primary">新增</a>

							<a href="javascript:a();" class="btn btn-primary">json</a>
						</div>
					</td>
				</tr> -->

				<script>
					function a() {

						var users = JSON.stringify([ {
						name : "wabiaozai1",
							pwd : "123"
						}, {
							name : "wabiaozai2",
							pwd : "123"
						} ]);
						alert(users);
						$.ajax({
							type : "post",
							url : "${base}/festivalactApi/aa",
							data : {"aa":"a","users":users},
							/* headers : {  
			                    'Content-Type' : 'application/json;charset=utf-8'  
			                }, */
							dataType : "json",
							success : function(response, ifo) {
								alert("success");
							},
							error : function() {
								alert("error");
							}
						})
					}
				</script>

				<input type="hidden" name="pageNo" value="${pagination.pageNo}" />


			</tbody>
		</table>
		<#include "/view/admin/pagination.html"/>
	</div>


</body>
</html>

<script>
	function setPage(pageNo, pageSize) {
		var href = "${base}/festivalact/list?";

		href += 'festName=' + $('#festName').val()+"&";
		href += 'reserve=' + $('#reserve').val()+"&";
		href += 'ext4=' + $('#ext4').val();

		href += "&pageNo=" + pageNo;
		href += "&pageSize=" + pageSize;
		location.href = href;
	}
</script>

<script>
	function doDelete(id) {
		var pageNo = $("input[name='pageNo']").val();
		if (window.confirm("你确定删除吗?")) {
			window.location = "${base}/festivalact/doDelete?ids=" + id
					+ "&pageNo=" + pageNo;
		}
	}
</script>
